<html>
<head>
<title>Search Form with Results</title>
        <meta name="layout" content="main" />
</head>
<body>
<table>
<g:message code="${flash.message}" />
	<g:form url="[action:'search']" method="post" >
	

			
			
			
			<g:textField name="keywords"  />
			<input value="search" type="submit" />
		</g:form>
		
<br />
Response Code: ${searchResponse?.responseCode}
<br />
Results Count: ${searchResponse?.totalHits}

<p>
Please note that we are re-creating the WS Client (groovyws) with every request.  Once we figure out how to do this only one time, the speed would be fast!
</p>


<hr>

<h1>Search Results</h1>
<ul>
                    <g:each in="${searchResponse?.searchResults}" status="i" var="searchResultInstance">

                                
                   	  <g:each in="${searchResultInstance.searchResult}"  var="searchResult">
                   		<li>  ${searchResult.contentVersionId}  ${searchResult.contentName}  ${searchResult.viewSecureToken}
                   		[<a href="<g:createLink action='findChildFolders' id="${searchResult.contentVersionId}"/>">view children</a>]
                   		
             <a href="<g:createLink controller='attributes' action='index' id="${searchResult.contentVersionId}"/>">attribute</a>
              
   
                      
                         
                            <g:each in="${searchResult?.contentDefHolder?.attributeHolders}" var="attributeHolderInstance">
                              <g:each in="${attributeHolderInstance.attributeHolder}"  var="attributeHolder">
                              
                              
                                                          ${attributeHolder.mimeType}
                             ${attributeHolder.name}
                            <g:if test="${attributeHolder.mimeType} == 'image/jpeg'">
   <img src="<stitches:createLinkToStitch params="[searchResult:searchResult,width:'100',attributeName:attributeHolder.name]"/>"/>
</g:if>
                            
                 [<a href="<stitches:createLinkToStitch params="[searchResult:searchResult,attributeName:attributeHolder.name]"/>">
                   	to stitch service</a>]
                   	
                   	
                              </g:each>
                              
					
                   	           
                            
              
                   	 </g:each>
                   	 

    
    

                   	                	
                   		
                   		
                   		</li>         
                   		  </g:each>
                   		
                   		     
                     
                    </g:each>

</ul>






</body>
</html>

		